package cn.itcast.service;

import cn.itcast.dao.UserClient;
import cn.itcast.dao.UserDao;
import cn.itcast.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class UserService {

    @Autowired
    private UserClient client;

    public List<User> queryUserByIds(List<Long> ids) {
        ArrayList<User> users = new ArrayList<>();
       ids.forEach(id ->{
           users.add(client.queryById(id));
       });
        return users;
    }
}
